#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: twl
@date: 2020/11/16 15:50
@description:
"""

import socket


class IpUtil(object):
    @staticmethod
    def get_host_ip():
        try:
            s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
            s.connect(('8.8.8.8', 80))
            ip = s.getsockname()[0]
            return ip
        finally:
            s.close()
